import React, { useState } from 'react';
import {
  Divider,
  Breadcrumb,
  Input,
  Button,
  Form,
  Select,
  Upload,
  Col,
  Row
} from 'antd';
import { PlusOutlined } from '@ant-design/icons'

const { TextArea } = Input;

const AddFood = () => {
  const [componentDisabled, setComponentDisabled] = useState(false);

  const onFormLayoutChange = ({ disabled }) => {
    setComponentDisabled(disabled);
  };
  return (
    <div style={{ width: '100%' }}>
      <div >
        <Breadcrumb>
          <Breadcrumb.Item>添加菜品</Breadcrumb.Item>
        </Breadcrumb>
        <Divider />
      </div>

      <Form
        labelCol={{
          span: 6,
        }}
        wrapperCol={{
          span: 5,
        }}
        layout="horizontal"
        onValuesChange={onFormLayoutChange}
        disabled={componentDisabled}
      >
        <Form.Item label="菜品">
          <Input placeholder="请输入菜名" />
        </Form.Item>
        <Form.Item label="价格">
          <Input placeholder="请输入价格" />
        </Form.Item>
        <Form.Item label="菜肴种类">
          <Select placeholder="请选择">
            <Select.Option value="热菜">热菜</Select.Option>
            <Select.Option value="凉菜">凉菜</Select.Option>
            <Select.Option value="饮品">饮品</Select.Option>
          </Select>
        </Form.Item>
        <Form.Item label="图片" valuePropName="fileList">
          <Upload action="/upload.do" listType="picture-card">
            <div>
              <PlusOutlined />
              <div
                style={{
                  marginTop: 8,
                }}
              >
                上传
              </div>
            </div>
          </Upload>
        </Form.Item>
        <Form.Item label="说明">
          <TextArea rows={4} placeholder="请输入内容" />
        </Form.Item>
        {/* <Form.Item> */}
          <Row justify="center">
          <Col span={2}><Button type="primary">提交</Button></Col>
          <Col span={8}><Button>重置</Button></Col>
        </Row>
        {/* </Form.Item> */}
        
      </Form>
    </div>
  );
}


export default AddFood